<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/finance/djlc/cw_djlc_djzb.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/finance/djlc/cw_djlc_djzb_browse.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'cw_djlc_djzb_id',
                footer: "Foots",
                cnName: '定价流程主表',
                name: 'djlc/cw_djlc_djzb',
                url: "/cw_djlc_djzb/browse",
                sortName: "CreateDate"
            });
            const editFormFields = ref({"oldbomnumber":"","newbomnumber":"","oldmaterialnum":"","newmaterialnum":"","configuration_type":"","potential_clients":"","sales_volume":"","expected_guide_price":"","share_development_expense":"","market_competitive_price":"","salechannel":"","new_product_upload":"","development_expense_remark":"","remark":""});
            const editFormOptions = ref([[{"title":"旧的BOM编号","field":"oldbomnumber"},
                               {"title":"新的BOM编号","field":"newbomnumber"}],
                              [{"title":"对标物料号","field":"oldmaterialnum",required:true},
                               {"title":"需求车型物料号","field":"newmaterialnum",required:true},],
                              [{"dataKey":"汽车种类","data":[],"title":"汽车种类","field":"configuration_type","type":"select",required:true},
                               {"title":"意向客户(可填无)","field":"potential_clients",required:true}],
                              [{"title":"销量","field":"sales_volume","type":"number",required:true},
                               {"title":"期望指导价","field":"expected_guide_price","type":"decimal",required:true}],
                              [{"title":"分摊研发费","field":"share_development_expense","type":"decimal",required:true},
                               {"title":"市场竞品价","field":"market_competitive_price","type":"file",required:true}],
                              [{"dataKey":"定价流程_销售渠道","data":[],"title":"销售渠道","field":"salechannel","type":"select",required:true},
                               {"title":"新产品上传企划书","field":"new_product_upload","type":"file"}],
                              [{"title":"研发费用备注","field":"development_expense_remark","type":"textarea"},
                               {"title":"备注","field":"remark","type":"textarea"}]]);
            //const searchFormFields = ref({"oldmaterialnum":"","newmaterialnum":""});
            //const searchFormOptions = ref([[{"title":"对标物料号","field":"oldmaterialnum","type":"like"},{"title":"需求物料号","field":"newmaterialnum","type":"like"}]]);
            const searchFormFields = ref({"is_enable":"","oldmaterialnum":"","newmaterialnum":""});
            const searchFormOptions = ref([[{"title":"对标物料号","field":"oldmaterialnum","type":"like"},{"title":"需求物料号","field":"newmaterialnum","type":"like"},{"dataKey":"产品定价流程启用状态","data":[],"title":"状态","field":"is_enable","type":"select"}]]);
            const columns = ref([{field:'cw_djlc_djzb_id',title:'定价流程主表',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'is_synchronization_status',title:'同步操作是否结束',type:'int',bind:{ key:'enable',data:[]},width:140,require:true,align:'left',sort:true},
                       {field:'is_synchronized_bom',title:'是否已从SAP同步到BOM',type:'int',bind:{ key:'enable',data:[]},width:140,require:true,align:'left'},
                       {field:'newmaterialnum',title:'需求车型物料号',type:'string',width:150,align:'left'},
                       {field:'oldmaterialnum',title:'对标物料号',type:'string',width:150,align:'left'},
                       {field:'configuration_type',title:'汽车种类',type:'string',bind:{ key:'汽车种类',data:[]},width:110,align:'left'},
                       {field:'cw_djlc_code',title:'定价流程编号',type:'string',width:180,align:'left'},
                       {field:'is_enable',title:'状态',type:'int',bind:{ key:'产品定价流程启用状态',data:[]},width:80,require:true,align:'left'},
                       {field:'oldbomnumber',title:'旧的BOM编号',type:'string',width:120,align:'left'},
                       //{field:'oldmaterialnum',title:'对标物料号',type:'string',width:160,align:'left'},
                       {field:'newbomnumber',title:'新的BOM编号',type:'string',width:120,align:'left'},
                      // {field:'newmaterialnum',title:'需求车型物料号',type:'string',width:160,align:'left'},
                       {field:'serialnum',title:'序号',type:'string',width:120,align:'left'},
                       {field:'category',title:'类别',type:'string',width:120,align:'left'},
                       {field:'vehicletype',title:'车型',type:'string',width:120,align:'left'},
                       {field:'drivetype',title:'驱动形式',type:'string',width:120,align:'left'},
                       {field:'fuel',title:'燃料',type:'string',width:120,align:'left'},
                       {field:'pilothouse',title:'驾驶室',type:'string',width:120,align:'left'},
                       {field:'enginetype',title:'发动机型号',type:'string',width:120,align:'left'},
                       {field:'transmissiontype',title:'变速器型号',type:'string',width:120,align:'left'},
                       {field:'stepid',title:'步骤状态',type:'int',width:110,hidden:true,align:'left'},
                       {field:'attachmenturl',title:'附件',type:'file',width:220,hidden:true,align:'left'},
                       {field:'processtype',title:'流程类型',type:'int',width:110,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Modifier',title:'修改人',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Creator',title:'创建人',type:'string',width:100,hidden:true,align:'left'},
                       {field:'salechannel',title:'销售渠道',type:'string',bind:{ key:'定价流程_销售渠道',data:[]},width:110,hidden:true,align:'left'},
                       {field:'cw_djlc_cwzb_id',title:'销售关键词',type:'guid',bind:{ key:'定价流程_变动制造和变动销售',data:[]},width:110,hidden:true,align:'left'},
                       {field:'marginalrate',title:'边际率',type:'decimal',width:110,hidden:true,align:'left'},
                       {field:'factoryprice',title:'标准出厂价',type:'decimal',width:110,hidden:true,align:'left'},
                       {field:'synchronizationpricestatus',title:'是否已同步价格 0：未同步，1：已同步',type:'int',width:80,hidden:true,require:true,align:'left'},
                       {field:'synchronizationbomstatus',title:'是否已同步BOM 0：未同步，1：已同步',type:'int',width:80,hidden:true,require:true,align:'left'},
                       {field:'bomtype',title:'物料类型',type:'byte',width:110,align:'left'},
                       {field:'cw_djlc_qddjgz_id',title:'渠道定价规则uuid',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'dcjb',title:'单车降本',type:'decimal',width:110,align:'left'},
                       {field:'is_have_bom',title:'原始物料是否已经有BOM，0:否，1:有',type:'int',width:80,require:true,align:'left'},
                      // {field:'configuration_type',title:'汽车种类',type:'string',bind:{ key:'汽车种类',data:[]},width:110,align:'left'},
                       {field:'sales_volume',title:'销量',type:'int',width:80,align:'left'},
                       {field:'potential_clients',title:'意向客户(可填无)',type:'string',width:220,align:'left'},
                       {field:'expected_guide_price',title:'期望指导价',type:'decimal',width:110,align:'left'},
                       {field:'share_development_expense',title:'分摊研发费',type:'decimal',width:110,align:'left'},
                       {field:'market_competitive_price',title:'市场竞品价',type:'file',width:220,align:'left'},
                       {field:'xny_power_battery_total_electricity',title:'动力电池总电量（kWh）',type:'string',width:220,align:'left'},
                       {field:'new_product_upload',title:'新产品上传企划书',type:'file',width:220,align:'left'},
                       {field:'is_have_disposition',title:'是否已上传配置表 0:未上传，1:已上传',type:'int',width:80,hidden:true,require:true,align:'left'},
                       {field:'air_bottle_testing',title:'气瓶检测',type:'decimal',width:110,align:'left'},
                       {field:'sale_keyword',title:'销售关键字',type:'string',width:220,align:'left'},
                       {field:'development_expense_remark',title:'研发费用备注',type:'string',width:220,align:'left'},
                       {field:'vehicle_logistics_fee',title:'整车物流费',type:'decimal',width:110,align:'left'},
                       {field:'development_expense',title:'研发费用',type:'decimal',width:110,align:'left'},
                       {field:'remark',title:'备注',type:'string',width:220,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
